home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20031118-20041115 / 000159_fdc@columbia.edu_Tue Mar 30 10:02:35 2004.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Path: newsmaster.cc.columbia.edu!not-for-mail
  2. From: Frank da Cruz <fdc@columbia.edu>
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: Re: Trying to connect to a device console via COM 1 (no dialing modem)
  5. Date: 30 Mar 2004 14:57:43 GMT
  6. Organization: Columbia University
  7. Lines: 87
  8. Message-ID: <slrnc6j2n7.gj9.fdc@sesame.cc.columbia.edu>
  9. References: <9c258be2.0403292240.2e00c890@posting.google.com> <9c258be2.0403300608.46d5097f@posting.google.com>
  10. Reply-To: fdc@columbia.edu
  11. NNTP-Posting-Host: sesame.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1080658663 14729 128.59.59.56 (30 Mar 2004 14:57:43 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 30 Mar 2004 14:57:43 GMT
  15. User-Agent: slrn/0.9.8.0 (SunOS)
  16. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14871
  17.  
  18. On 2004-03-30, Klein Bill <collector59ca@yahoo.com> wrote:
  19. > I'm trying to connect to the ASCII terminal of a manageable router
  20. > device which is directly connected to my serial port COM 1.
  21. > I'm using the following Kermit script:
  22. > ...
  23. > When running this script, kermit stays in command mode but I see no
  24. > dialog between it and the router even though I've used "set input 
  25. > echo on".
  26. >
  27. > If I press Alt-x the terminal window is opened and my command is
  28. > finally sent (but I remain in terminal mode).
  29. > How can I make Kermit show me the interaction in command mode ? 
  30. By having an INPUT command active to process the incoming material.
  31.  
  32. > I've made a FINAL UPDATE...
  33. > ****************************************
  34. > set input echo on
  35. > set modem type none
  36. > set carrier-watch off
  37. > set line  1
  38. > set serial 8n1
  39. > set speed 115200
  40. > output \13
  41. > input 2 console>
  42. > lineout show config
  43. > INPUT -1 STRING_THAT_NEVER_COMES
  44. > *****************************************
  45. > And this time Kermit showed me the full interaction in command mode.
  46. > Why isn't it possible to obtain the interaction dialog in command mode
  47. > without having an endless waiting condition at the end of the script ?
  48. > Why set input echo on is not enough? If it is possible to get the
  49. > interaction in command mode without the "STRING_THAT_NEVER_COMES" part
  50. > I'd like to know the way.
  51. >
  52. SET INPUT ECHO ON is a command that makes the INPUT command echo whatever
  53. comes in while it is running.  If the INPUT command is not running, it
  54. won't be able to echo anything.  The first version of your script ended
  55. with "lineout show config", which sends "show config" (and a line-end)
  56. to the router, but then included no further commands to read its response.
  57. In fact the script simply stopped at that point, because it had executed
  58. its final command.
  59.  
  60. Adding the INPUT command to the end of the script, as you have discovered,
  61. makes it read the response and, when INPUT ECHO is ON, also display it on
  62. the screen as desired.
  63.  
  64. The real question is: how should the INPUT command terminate?  You have
  65. the following choices:
  66.  
  67.  . Never (use -1 as a timeout and specify a string that will never come).
  68.    In this case you can still interrupt it from the keyboard.  Example:
  69.  
  70.      INPUT -1 STRING_THAT_WILL_NEVER_COME
  71.  
  72.  . When a specified string comes before a given time limit (e.g. the
  73.    next router prompt).  Example:
  74.  
  75.      INPUT 20 "\13\10> "   ; Wait up to 20 sec for router prompt
  76.      IF FAIL ...           ; What to do if it didn't come
  77.  
  78.  . When the specified time limit expires (and the given string did not
  79.    comes) -- same as the previous example, except the IF FAIL commands
  80.    are executed.
  81.  
  82.  . When a specified string is already waiting in the input buffer:
  83.  
  84.      INPUT 0 OK            ; "OK" must already be there.
  85.      IF FAIL...
  86.  
  87. You can also give a time-of-day instead of a number of seconds, to make
  88. INPUT wait until the given time:
  89.  
  90.      INPUT 23:59:59 "Operation Complete"
  91.      IF FAIL ...
  92.  
  93. And as you probably know, you can also have INPUT look for a pattern
  94. rather than a literal string by using \fpattern() as or in the search
  95. target.
  96.  
  97. And finally you can use MINPUT instead of INPUT to specify multiple
  98. search targets, possibly including patterns.
  99.  
  100. - Frank